package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;

/**
 * 活动发放奖励记录
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "activity_award_log")
public class ActivityAwardLog {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 奖励接收人 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    /**
     * 邀请奖励时 - 被邀请人
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "be_invited_user_id")
    private User beInvitedUser;

    /**
     * 活动类型
     */
    private String type;

    /**
     * 有效金额（用于红包等规则校验金额区间），多指投资金额
     */
    private double money;

    /**
     * 奖励的红包记录对象
     */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_red_envelope_id")
    private UserRedEnvelope userRedEnvelope;

    /**
     * 奖励的体验券记录对象
     */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "experience_id")
    private Experience experience;

    /**
     * 奖励的加息券记录对象
     */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "rate_interest_id")
    private RateInterest rateInterest;

    /**
     * 添加时间
     */
    private Date addTime;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getBeInvitedUser() {
        return beInvitedUser;
    }

    public void setBeInvitedUser(User beInvitedUser) {
        this.beInvitedUser = beInvitedUser;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }


    public UserRedEnvelope getUserRedEnvelope() {
        return userRedEnvelope;
    }

    public void setUserRedEnvelope(UserRedEnvelope userRedEnvelope) {
        this.userRedEnvelope = userRedEnvelope;
    }

    public Experience getExperience() {
        return experience;
    }

    public void setExperience(Experience experience) {
        this.experience = experience;
    }

    public RateInterest getRateInterest() {
        return rateInterest;
    }

    public void setRateInterest(RateInterest rateInterest) {
        this.rateInterest = rateInterest;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

}
